﻿using System.Collections.Generic;

namespace MvcForum.Net.Bussiness
{
    public class EmailQueueRepo
    {
        public static void Save(Email email)
        {
            MainDB.Instant.EmailQueue_Save(email.From, email.To, email.Subject, email.Body,email.Priority).Execute();
        }

        public static void Save(string from, string to, string subject, string body, EmailPriority priority)
        {
            MainDB.Instant.EmailQueue_Save(from, to, subject, body,(short)priority).Execute();
        }

        public static List<Email> List()
        {
            return MainDB.Instant.EmailQueue_List().ExecuteTypedList<Email>();
        }

        public static void Del(int id)
        {
            MainDB.Instant.EmailQueue_Delete(id).Execute();
            
        }
    }
}